/**
 * Created with IntelliJ IDEA.
 * Description: 封装
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-05-02  09:18
 */

class Student {
    private String name;
    private int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}
public class Test {
    public static void main(String[] args) {
        Student student = new Student("zhangsan",20);
        System.out.println(student.getName());
    }
}
